package com.pi.smart.base.task.processor;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;

import com.pi.dc.model.DcBedStatusPostForm;
import com.pi.dc.service.DcBedService;
import com.pi.dc.service.HcUserSleepLogService;
import com.pi.smart.base.task.UserSleepLogTask;
import com.pi.smart.client.ins.bed.annotation.ForBedIns;
import com.pi.smart.client.ins.bed.category.BedInsEnum;
import com.pi.smart.client.ins.bed.domain.SmartBedCmd;
import com.pi.smart.client.ins.bed.domain.SmartBedRoutineResponse;
import com.pi.smart.client.ins.bed.variety.BedInsHandler;

@ForBedIns(ins = BedInsEnum.SYSTEM_INI)
@Component
public class BedIniProcessor implements BedInsHandler{
  
  private static final Logger logger = LoggerFactory.getLogger(UserSleepLogTask.class);
  
  @Autowired
  private HcUserSleepLogService userSleepLogService;
  @Autowired
  private DcBedService dcBedService;
  
  @Override
  public void process(SmartBedCmd cmd) {
    if(null == cmd)
      return;
    try{
      handle(cmd);
    }catch(Exception e){
      logger.error("处理被子的实时状态数据失败", e);
    }
  }
  
  private void handle(SmartBedCmd cmd){
      handleSystemIni(cmd);
  }
  
  private void handleSystemIni(SmartBedCmd cmd) {
    logger.info("系统初始化并下发时间同步成功，  设备: {} ts: {}", cmd.getDevCode(), cmd.getTs());
  }
}
